Search results

Types

Classes
Interfaces
Enums
Functions
Type aliases
Constants

Members

Properties
Methods
Getters
Setters
Enum members
Show privates

Other

In this module only

Class PlayerCollector

Defined in index.ts

extends Mapexternal item Map<number, Playerclass PlayerStructures/Player>

Constructor

constructor(game: Gameclass GameStructures/Game)

    Properties

    game: Gameclass GameStructures/Game

    Methods

    add(address: number): Playerclass PlayerStructures/Player | null

      Add a new player by providing a pointer to a player class. This method is used internally.

      fetch(): void

        Fetches all players and clears the map.

        fetchPlayerArray(): { count: number, firstPlayerAddress: number }

          Returns the address of the first player in the player array, and the length of the array.

          filter(cb: PlayerCollectorFiltertype PlayerCollectorFilterCollectors/PlayerCollectorFilter): Arrayexternal item Array<Playerclass PlayerStructures/Player>

            Filters all players in the map. Similar to Array#map